package com.yidu.logisticssystem.service.impl;

import com.yidu.logisticssystem.entity.LogisticsDetailtype;
import com.yidu.logisticssystem.dao.LogisticsDetailtypeDao;
import com.yidu.logisticssystem.service.LogisticsDetailtypeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 状态详细类型表(LogisticsDetailtype)表服务实现类
 * @author makejava
 * @since 2021-03-08 16:46:48
 */
@Service("logisticsDetailtypeService")
public class LogisticsDetailtypeServiceImpl implements LogisticsDetailtypeService {
    @Resource
    private LogisticsDetailtypeDao logisticsDetailtypeDao;

    /**
     * 通过ID查询单条数据
     *
     * @param detailtypeId 主键
     * @return 实例对象
     */
    @Override
    public LogisticsDetailtype queryById(Integer detailtypeId) {
        return this.logisticsDetailtypeDao.queryById(detailtypeId);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<LogisticsDetailtype> queryAllByLimit(int offset, int limit) {
        return this.logisticsDetailtypeDao.queryAllByLimit(offset, limit);
    }

    /**
     * 新增数据
     *
     * @param logisticsDetailtype 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(LogisticsDetailtype logisticsDetailtype) {
        return logisticsDetailtypeDao.insert(logisticsDetailtype);
    }

    /**
     * 修改数据
     *
     * @param logisticsDetailtype 实例对象
     * @return 实例对象
     */
    @Override
    public int update(LogisticsDetailtype logisticsDetailtype) {
        return logisticsDetailtypeDao.update(logisticsDetailtype);
    }

    /**
     * 通过主键删除数据
     *
     * @param detailtypeId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer detailtypeId) {
        return this.logisticsDetailtypeDao.deleteById(detailtypeId) > 0;
    }
}
